package wongsir.chapter2;

/**
 * @Description: Java栈溢出测试
 * 参数：-Xss128k
 * @author huangjd
 * @date 2018年4月15日
 */
public class JavaVMStackSOF {
	private int stackLength = 1;
	
	public void stackLeak(){
		stackLength++;
		stackLeak();
	}
	
	public static void main(String[] args) {
		JavaVMStackSOF oom = new JavaVMStackSOF();
		try {
			oom.stackLeak();
		} catch (Exception e) {
			System.out.println("stack length:"+oom.stackLength);
			e.printStackTrace();
		}
	}
}
